Product Code Database
Example Keywords: e-readers -retro $93-150
   » » Wiki: Trojan Source
Tag Wiki 'Trojan Source'.
Tag

Related Products

Lapidus's classic A History of Islamic Societies has been substantially revised to incorporate the insights of new scholarship and updated to include historical developments in the first decade of the twenty-first century. Lapidus's history explores the be..

Jonathan Bloom and Sheila Blair, leading historians on Islamic culture and art, explore the development and evolution of a culturally distinctive art form with Islamic ...

A source of Western civilization, it may be destroyed by its main beneficiary. This tour of Iran explores the rich history of this pivotal country: the Achaemenians (Cyrus/Darius/Xerxes), the Sasanians, the Zoroastrian religion of 2,500 years ago; the Isla..

Stating that belief equals knowledge and that the convictions underlying nonbelief are ignorance and absence of judgment, this spirituality-affirming compendium features essays that introduce the pillars of faith for the Islamic tradition and give a broade..

Since then, love has dominated the Turks' poetic modes and moodspre-Islamic, Ottoman classical, folk, modern. In style, form and sensibility, this collection offers a broad spectrum: virtually all types and varieties are represented here. The English versi..

The contributors analyze such subjects as terrorism, suicide attacks, jihad in consultation with first hand sources of Islam. All the articles in the book reject the idea that Islam approves terrorism. This book is prime example of the efforts in the Islam..

With its powerful 1.6 GHz Dual Core processor and 1 GB RAM, the Android experience is smooth and quick. The 7 inch high resolution 1024 x 600 screen brings crystal clarity to your movies and games and the 5 point capacitive multi touch makes finger gestu..

Strike King Crankbait Lure Kit Type: Project Lamp Specifications: Strike King Crankbait Lure Kit

Trojan Source is a software vulnerability that abuses 's bidirectional characters to display differently than the actual execution of the source code. The exploit utilizes how writing scripts of different reading directions are displayed and encoded on computers. It was discovered by Nicholas Boucher and Ross Anderson at Cambridge University in late 2021.


Background
Unicode is an encoding standard for representing text, symbols, and glyphs. Unicode is the most dominant encoding on computers, used in over 98% of websites . It supports many languages, and because of this, it must support different methods of writing text. This requires support for both left-to-right languages, such as English and Russian, and right-to-left languages, such as and . Since Unicode aims to enable using more than one writing system, it must be able to mix scripts with different display orders and resolve conflicting orders. As a solution, Unicode contains characters called bidirectional characters ( Bidi) that describe how text is displayed and represented. These characters can be abused to change how text is interpreted without changing it visually, as the characters are often invisible.

+Relevant Unicode bidirectional formatting characters !Abbreviation !Name !Description
LRE Try treating following text as left-to-right.
RLE Try treating following text as right-to-left.
LRO Force treating following text as left-to-right.
RLO Force treating following text as right-to-left.
LRI Force treating following text as left-to-right without affecting adjacent text.
RLI Force treating following text as right-to-left without affecting adjacent text.
FSI Force treating following text in direction indicated by the next character.
PDF Terminate nearest LRE, RLE, LRO, or RLO.
PDI Terminate nearest LRI or RLI.


Methodology
In the exploit, bidirectional characters are abused to visually reorder text in source code so that later execution occurs in a different order. Bidirectional characters can be inserted in areas of source code where string literals are allowed. This often applies to documentation, variables, or comments.

+Vulnerable Python code !Source code with hints !Source code displayed visually !Source code interpreted
def sum(num1, num2):
 '''Add num1 and num2, and [RLI] ''' ;return
 return num1 + num2
     
def sum(num1, num2):
 '''Add num1 and num2, and return; '''
 return num1 + num2
     
def sum(num1, num2):
 '''Add num1 and num2, and ''' ;
 return
 return num1 + num2
     

In the above example, the RLI mark (right-to-left isolate) forces the following text to be interpreted differently than it is displayed: the triple-quote is first (ending the string), followed by a semicolon (starting a new line), and finally with the premature return (returning and ignoring any code below it). The new line terminates the RLI mark, preventing it from flowing into the below code. Because of the Bidi character, some source code editors and IDEs rearrange the code for display without any visual indication that the code has been rearranged, so a human code reviewer would not normally detect them. However, when the code is inserted into a compiler, the compiler may ignore the Bidi character and process the characters in a different order than visually displayed. When the compiler is finished, it could potentially execute code that visually appeared to be non-executable. Formatting marks can be combined multiple times to create complex attacks.


Impact and mitigation
Programming languages that support Unicode strings and follow Unicode's Bidi algorithm are vulnerable to the exploit. This includes languages like Java, Go, C, C++, C#, Python, and .

While the attack is not strictly an error, many compilers, interpreters, and websites added warnings or mitigations for the exploit. Both and received requests to deal with the exploit. Marek Polacek submitted a patch to GCC shortly after the exploit was published that implemented a warning for potentially unsafe directional characters; this functionality was merged for GCC 12 under the -Wbidi-chars flag. LLVM also merged similar patches. Rust fixed the exploit in 1.56.1, rejecting code that includes the characters by default. The developers of Rust found no vulnerable packages prior to the fix.

Many source code editors and IDEs now make these potentially unsafe characters more visible. Visual Studio Code now renders control characters by default. Notepad++ and vim already made these characters more visible, as noted in the research paper.

issued an advisory on their website, labeling the exploit as "moderate". released a warning on their blog, as well as updating the website to show a dialog box when Bidi characters are detected in a repository's code.


External links

Page 1 of 1
1
Post Comment
Font Size...
Font Family...
Font Format...

Page 1 of 1
1

Account

Social:
Pages:  ..   .. 
Items:  .. 

Navigation

General: Atom Feed Atom Feed  .. 
Help:  ..   .. 
Category:  ..   .. 
Media:  ..   .. 
Posts:  ..   ..   .. 

Statistics

Page:  .. 
Summary:  .. 
1 Tags
10/10 Page Rank
5 Page Refs
1s Time